/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Lab6_test;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author c0909h1169
 */
public class ThreadOne implements Runnable {

    Thread t;
    Data d;

    public ThreadOne(Data d) {
        this.d = d;
        t = new Thread(this);
        t.start();
    }

    public void run() {
        //throw new UnsupportedOperationException("Not supported yet.");

        synchronized (d) {
            if (!d.flag) {
                d.getArr();
                d.flag = true;
                d.notify();
            }
            try {
                d.wait();
            } catch (InterruptedException ex) {
                //Logger.getLogger(ThreadOne.class.getName()).log(Level.SEVERE, null, ex);
            }
        }


    }
}
